# File Information --------------------------------------------------------

  # Title: ModelingCSDHPreliminaryReplication.R
  # Date: July 2024
  # R Version: R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
  # Purpose: Reproduce the results in Modeling CSDH for IPE Data (IJPE)

# Clear R -----------------------------------------------------------------
  rm(list = ls())

# Packages ----------------------------------------------------------------

  # Install Packages
  #  install.packages("tidyverse","readstata13","xtable")
  
  # Load Packages
    library(tidyverse)
    library(readstata13)
    library(xtable)
  
# Load Data ---------------------------------------------------------------

  # Working Directory
    setwd("/Users/claywebb/Dropbox/farmseriescropsectional/Replication Materials/")

  # Load MC Results Data
    load("AboutTimeMixed.RData")
    load("AboutTimePool.RData")
    
  # Data Frames
    mix_dat <- as_tibble(bias_array_mixed)
    pool_dat <- as_tibble(bias_array_pool)
    
  # MK Replication Data
    mkdat <- as_tibble(read.dta13("MilnerKubota_IO_replicationWithFX.dta"))
    
# Figure 1: Statutory Tariff Rates ----------------------------------------
    
    dev.off()
  # PDF for Figure 1  
    pdf("fig1tariffs.pdf", width = 14, height = 7)
    
    par(mfrow=c(2,2),mai = c(0.075, 0.25, .25, 0.25),oma=c(2,4,1,.025))
    layout(matrix(c(1,2,3,4),2,2,byrow=F))
    
    plot(subset(mkdat$date, mkdat$ctylabel == "Brazil"), subset(mkdat$newtar, mkdat$ctylabel == "Brazil"), type = "l",
         ylab ="Exports as % of GDP", xlab = "", lwd = 3, main = "", cex.main = 1.5, las = 1, xaxt = "n", yaxt = "n")
    axis(2, las = 1, cex.axis = 1.5)
    title("Brazil", line = .6, cex.main = 1.5)
    plot(subset(mkdat$date, mkdat$ctylabel == "Peru"), subset(mkdat$newtar, mkdat$ctylabel == "Peru"), type = "l",
         ylab ="", xlab = "", lwd = 3, main = "", cex.main = 1.5, las = 1, yaxt = "n", xaxt = "n")
    title("Peru", line = .6, cex.main = 1.5)
    axis(2, las = 1, cex.axis = 1.5)
    axis(1, las = 1, cex.axis = 1.5)
    plot(subset(mkdat$date, mkdat$ctylabel == "Ghana"), subset(mkdat$newtar, mkdat$ctylabel == "Ghana"), type = "l",
         ylab ="Exports as % of GDP", xlab = "", lwd = 3, main = "", cex.main = 1.5, las = 1, xaxt = "n", yaxt = "n")
    title("Ghana", line = .6, cex.main = 1.5)
    axis(2, las = 1, cex.axis = 1.5)
    plot(subset(mkdat$date, mkdat$ctylabel == "Jordan"), subset(mkdat$newtar, mkdat$ctylabel == "Jordan"), type = "l",
         ylab ="Exports as % of GDP", xlab = "", lwd = 3, main = "", cex.main = 1.5, las = 1, yaxt = "n", xaxt = "n")
    title("Jordan", line = .6, cex.main = 1.5)
    axis(2, las = 1, cex.axis = 1.5)
    axis(1, las = 1, cex.axis = 1.5)
    mtext("Tariff Rates", side=2, outer=TRUE, line=1.5, cex = 1.75)
    
    dev.off()
   
# Figure 2: PACFs Statutory Tariff Rates ----------------------------------

  # PDF for Figure 2
    pdf("fig2pacfs.pdf", width = 14, height = 7)
    
    par(mfrow=c(2,2),mai = c(0.075, 0.4, .25, 0.25),oma=c(2,4,1,.025))
    layout(matrix(c(1,2,3,4),2,2,byrow=F))
    
    pacf(na.omit(subset(mkdat$newtar, mkdat$ctylabel == "Brazil")), lag.max = 5, lwd = 3, las = 1, xaxt = "n", yaxt = "n", ylim = c(-.5,.9)) 
    axis(2, las = 1, cex.axis = 1.5)
    title("Brazil", line = .6, cex.main = 1.5)
    pacf(na.omit(subset(mkdat$newtar, mkdat$ctylabel == "Peru")), lag.max = 5, lwd = 3, las = 1, xaxt = "n", yaxt = "n", ylim = c(-.55,.85)) 
    title("Peru", line = .6, cex.main = 1.5)
    axis(2, las = 1, cex.axis = 1.5)
    axis(1, las = 1, cex.axis = 1.5)
    pacf(na.omit(subset(mkdat$newtar, mkdat$ctylabel == "Ghana")), lag.max = 5, lwd = 3, las = 1, xaxt = "n", yaxt = "n",  ylim = c(-.5,.9)) 
    axis(2, las = 1, cex.axis = 1.5)
    title("Ghana", line = .6, cex.main = 1.5)
    pacf(na.omit(subset(mkdat$newtar, mkdat$ctylabel == "Jordan")), lag.max = 5, lwd = 3, las = 1, xaxt = "n", yaxt = "n", ylim = c(-.5,.9)) 
    title("Jordan", line = .6, cex.main = 1.5)
    axis(2, las = 1, cex.axis = 1.5)
    axis(1, las = 1, cex.axis = 1.5)
    mtext("Tariff Rates", side=2, outer=TRUE, line=2, cex = 1.75)
    
    dev.off()
    
# Prepare Bias Data -------------------------------------------------------

  # Effect Heterogeneity
    mix_dat$eta <- mix_dat$ar1H - mix_dat$ar1L
    pool_dat$eta <- pool_dat$ar1H - pool_dat$ar1L
    
  # Subset of Data Used to Replicate Plots
    mix_dat_9 <- subset(mix_dat, eta > -0.1 & ar1H == 0.9)  
    pool_dat_9 <- subset(pool_dat, eta > -0.1 & ar1H == 0.9)  
    
  # Bias and RMSE (Pool)
    pool_dat_9$lrmbias <- ((pool_dat_9$X50qBiasB1 + pool_dat_9$X50qBiasb2)/(1 - pool_dat_9$X50qBiasa1))*100
    pool_dat_9$lrmrmse <- sqrt(((pool_dat_9$X50qBiasB1 + pool_dat_9$X50qBiasb2)/(1 - pool_dat_9$X50qBiasa1))^2)
    
  # Bias and RMSE (Mixed)  
    mix_dat_9$lrmbias <- ((mix_dat_9$X50qBiasB1 + mix_dat_9$X50qBiasb2)/(1 - mix_dat_9$X50qBiasa1))*100
    mix_dat_9$lrmbiaschk <- ((mix_dat_9$X50qBiasb1pct + mix_dat_9$X50qBiasb2pct)/(1 - mix_dat_9$X50qBiasa1pct))
    mix_dat_9$lrmrmse <- sqrt(((mix_dat_9$X50qBiasB1 + mix_dat_9$X50qBiasb2)/(1 - mix_dat_9$X50qBiasa1))^2)
    mix_dat_9_subkappa <- subset(mix_dat_9, mix_dat_9$kappa > 0)
    
# Figure 3: POLS % Bias Given Lag and Effect Heterogeneity ----------------

  # Labels for Effect and Lag Heterogeneity
    etalabs <- c("Effect Het = 0","Effect Het = 0.4","Effect Het = 0.8")
    names(etalabs) <- c(0,0.4,0.8)
    
    kappalabs <- c("1 DGP","2 DGP","3 DGP","4 DGP")
    names(kappalabs) <- c(0,1,2,3)
    
  # Figure 3  
    pdf("fig3poolbias.pdf", width = 14, height = 7)
    
    ggplot(data = pool_dat_9, aes(x = cs, y = lrmbias, group = t)) +
      geom_line(aes(linetype = factor(t)), lwd = 1.5) +
      geom_point() + 
      theme_bw() + 
      theme(axis.text.y = element_text(angle = 0,  hjust = 0.5, size = 20),
            axis.text.x = element_text(angle = 0,  hjust = 0.5, size = 20),
            axis.title.x = element_text(size = "25", margin = unit(c(0, 0, 5, 0), "mm")),
            axis.title.y = element_text(size = "25", margin = unit(c(0, 0, 0, 10), "mm")),
            strip.text = element_text(size = "25")) +
      ylab(expression(paste("% Bias in LRM \n"))) +
      xlab(expression(paste("\n\n# of Cross Sections"))) +
      scale_y_continuous(limits=c(-225,5)) +
      #scale_y_continuous(name = expression(paste("\n Bias in ",beta[1])),limits=c(-2, 20)) +
      scale_x_continuous(breaks = c(10, 50, 100)) +
      labs(linetype = "# of Time Points =  ") +
      theme(legend.position = "bottom",
            legend.title = element_text(size = 25),
            legend.text = element_text(size = 25),
            legend.key.width = unit(5,"cm")) +
      facet_grid(kappa ~ eta, labeller = labeller(eta = etalabs, kappa = kappalabs))
    
    dev.off()
    

# Figure 4: Dynamic Mixed Effects % Bias Given Lag and Effect Hete --------

  # Labels for Lags and Effect Heterogeneity
    etalabs <- c("Effect Het = 0","Effect Het = 0.4","Effect Het = 0.8")
    names(etalabs) <- c(0,0.4,0.8)
    
    kappalabs <- c("2 DGP","3 DGP","4 DGP")
    names(kappalabs) <- c(1,2,3)
    
  # Figure 4
    pdf("fig3mixbias.pdf", width = 14, height = 7)
    
    ggplot(data = mix_dat_9_subkappa, aes(x = cs, y = lrmbias, group = t)) +
      geom_line(aes(linetype = factor(t)), lwd = 1.5) +
      geom_point() + 
      theme_bw() + 
      theme(axis.text.y = element_text(angle = 0,  hjust = 0.5, size = 20),
            axis.text.x = element_text(angle = 0,  hjust = 0.5, size = 20),
            axis.title.x = element_text(size = "25", margin = unit(c(0, 0, 5, 0), "mm")),
            axis.title.y = element_text(size = "25", margin = unit(c(0, 0, 0, 10), "mm")),
            strip.text = element_text(size = "25")) +
      ylab(expression(paste("% Bias in LRM\n"))) +
      xlab(expression(paste("\n\n# of Cross Sections"))) +
      scale_y_continuous(limits=c(-225,5)) +
      #scale_y_continuous(name = expression(paste("\n Bias in ",beta[1])),limits=c(-2, 20)) +
      scale_x_continuous(breaks = c(10, 50, 100)) +
      labs(linetype = "# of Time Points =  ") +
      theme(legend.position = "bottom",
            legend.title = element_text(size = 25),
            legend.text = element_text(size = 25),
            legend.key.width = unit(5,"cm")) +
      facet_grid(kappa ~ eta, labeller = labeller(eta = etalabs, kappa = kappalabs))
    
    dev.off()
    

# Figure 5: Distribution of Tarifft−1 and LRM for Polity on Tarifft -------

  # Figure 5
    pdf("fig5distributions.pdf", width = 14, height = 7)
    
    par(mfrow=c(1,2), oma=c(.5,1.5,.25,.25), mai = c(.85, .75, .25, .05))
    plot(density(na.omit(unique(mkdat$lagtarifffx))),
         lwd = 3, las = 2, xaxt = "n", xlab = "", ylab = "", yaxt = "n",
         cex.lab = 2,
         main = "", cex.main = 2.0, lty = 1)
    axis(1, las=1, at=c(0.65, 0.70, 0.75, 0.80, 0.85, 0.90), cex.axis = 2)
    axis(2, las=1, cex.axis = 2)
    abline(v=.767,lwd = 2, lty = 2)
    abline(v=.766,lwd = 2, lty = 3)
    mtext(side = 2,"Density", line = 3.5, cex = 2.0)
    mtext(side = 1,expression(paste("Tariff Rate"[t-1])), line = 3.5, cex = 2.0)
    legend(x = .83, y = 18, legend = c("Mean = 0.767", "Median = 0.766","SD = 0.034"), lty=c(2,3,0), 
           bty = "n", cex = 1.5, lwd = 3)
    
    plot(density(na.omit(unique(mkdat$lrmtariff))),
         lwd = 3, las = 2, xaxt = "n", xlab = "", ylab = "", yaxt = "n",
         cex.lab = 2,
         main = "", cex.main = 2.0, lty = 1)
    axis(1, las=1, cex.axis = 2)
    axis(2, las=1, cex.axis = 2)
    abline(v=-.385,lwd = 2, lty = 2)
    abline(v=-.375,lwd = 2, lty = 3)
    mtext(side = 1,expression(paste("LRM Polity")), line = 3.5, cex = 2.0)
    legend(x = -0.80, y = 11, legend = c("Mean = -0.385", "Median = -0.375","SD = 0.072"), lty=c(2,3,0), 
           bty = "n", cex = 1.5, lwd = 3)
    
    dev.off()
    
# Table A1: POLS % Bias Given Lag and Effect Heterogeneity ----------------

  # beta-1 pct bias pooled
    b1_array_med_pct_bias_pool <- rbind(cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasB1pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasB1pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasB1pct))))
    
    rownames(b1_array_med_pct_bias_pool) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(b1_array_med_pct_bias_pool) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    b1_array_med_pct_bias_pool
    
  # beta-2 % bias pooled
    b2_array_med_pct_bias_pool <- rbind(cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasb2pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasb2pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasb2pct))))
    
    rownames(b2_array_med_pct_bias_pool) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(b2_array_med_pct_bias_pool) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    b2_array_med_pct_bias_pool
    
  # alpha-1 % bias pooled
    a1_array_med_pct_bias_pool <- rbind(cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1pct))),
                                   cbind(rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct)),
                                         rbind(cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct),
                                               cbind(subset(bias_array_pool, bias_array_pool$cs == 10  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 50  & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct,
                                                     subset(bias_array_pool, bias_array_pool$cs == 100 & bias_array_pool$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1pct))))
  
    rownames(a1_array_med_pct_bias_pool) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(a1_array_med_pct_bias_pool) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    a1_array_med_pct_bias_pool
    
  # Table A1: POLS % Bias Given Lag and Effect Heterogeneity  
    pct_bias_tab_pool <- rbind(a1_array_med_pct_bias_pool,
                               b1_array_med_pct_bias_pool,
                               b2_array_med_pct_bias_pool)
    
  # Export Table
    xtable(pct_bias_tab_pool)
    
# Table A2: Dynamic Mixed Effects % Bias Given Lag and Effect Heterogeneity ----

  # alpha-1 % bias mixed
    a1_array_med_pct_bias_mixed <- rbind(cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)$X50qBiasa1))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)$X50qBiasa1))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1)),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1,
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)$X50qBiasa1))))
    
    rownames(a1_array_med_pct_bias_mixed) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(a1_array_med_pct_bias_mixed) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    a1_array_med_pct_bias_mixed
    
  # beta-1 % bias mixed
    b1_array_med_pct_bias_mixed <- rbind(cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasB1"]))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasB1"]))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasB1"]))))
    
    rownames(b1_array_med_pct_bias_mixed) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(b1_array_med_pct_bias_mixed) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    b1_array_med_pct_bias_mixed
    
  # beta-2 % bias mixed
    b2_array_med_pct_bias_mixed <- rbind(cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.9 & ar1H ==0.9)[,"X50qBiasb2"]))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.5 & ar1H ==0.9)[,"X50qBiasb2"]))),
                                   cbind(rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 0 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 1 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 2 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"])),
                                         rbind(cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 10  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 50  & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]),
                                               cbind(subset(bias_array_mixed, bias_array_mixed$cs == 10  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 50  & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"],
                                                     subset(bias_array_mixed, bias_array_mixed$cs == 100 & bias_array_mixed$t == 100 & kappa == 3 & ar1L == 0.1 & ar1H ==0.9)[,"X50qBiasb2"]))))
    
    rownames(b2_array_med_pct_bias_mixed) <- c("t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100","t = 10", "t = 50", "t = 100")
    colnames(b2_array_med_pct_bias_mixed) <- c("cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100","cs = 10", "cs = 50", "cs = 100", "cs = 10", "cs = 50", "cs = 100")
    
    b2_array_med_pct_bias_mixed
    
    pct_bias_tab_mixed  <- rbind(a1_array_med_pct_bias_mixed,
                                 b1_array_med_pct_bias_mixed,
                                 b2_array_med_pct_bias_mixed)
    
    
  # Export
    xtable(pct_bias_tab_mixed)
    
